﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;


namespace SGTLightAccent.Views
{
    public partial class IngresoRemitosWindow : ChildWindow
    {
        public IngresoRemitosWindow(string titulo)
        {
            InitializeComponent();
            this.Title = titulo;
            if (WebContext.Current.User.IsInRole("operador"))
            {
                this.Bruto1.IsEnabled = false;
                this.Bruto2.IsEnabled = false;
                this.Tara1.IsEnabled = false;
                this.Tara2.IsEnabled = false;
                this.PNeto.IsEnabled = false;
            }
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            /*PlantillaRemito plantilla = new PlantillaRemito();
                PrintDocument pd = new PrintDocument();

                // Set the printable area
          
                pd.PrintPage += (s, args) =>
                {
                    this.btnGuardar.Visibility = Visibility.Collapsed;
                    this.btnImprimir.Visibility = Visibility.Collapsed;
                    this.CancelButton.Visibility = Visibility.Collapsed;
                  
                    //args.PageVisual = this.LayoutRoot;
               
                  
                   
                        ScaleTransform scaleTransform = new ScaleTransform();
                        scaleTransform.ScaleX = 1;
                        scaleTransform.ScaleY = 1;
                        plantilla.RenderTransform = scaleTransform;
                    


                    args.PageVisual = plantilla;
                };
    
                pd.EndPrint += (s, args) => 
                {
                    this.btnGuardar.Visibility = Visibility.Visible;
                    this.btnImprimir.Visibility = Visibility.Visible;
                    this.CancelButton.Visibility = Visibility.Visible;
                   
                };
    
                // Print the document
                pd.Print("Remito");*/
            
        }


        
    }
}

